import time
import unittest
from lib.HTMLTestRunner import HTMLTestRunner
from script.test01_login import login
from script.test03_currentPage import TestCurrentPage

# 执行测试套件入口
# suite = unittest.TestSuite()
# suite.addTest(login("test01_login"))
# suite.addTest(TestCurrentPage("test01_current_page"))
# unittest.TextTestRunner().run(suite)

suite = unittest.TestLoader().discover("./script", "test*.py")
# file = "./report/report-{}.html".format(time.strftime("%Y%m%d-%H%M%S"))
file = "./report/report.html"
with open(file, "wb") as f:
    runner = HTMLTestRunner(f, title="接口测试")
    runner.run(suite)
